<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Vue入门指南-Vue组件生命周期</title>
    <link rel="stylesheet" href="common.css">
    <script type="importmap">
        {
            "imports":{
                "vue":"http://lib.baomitu.com/vue/latest/vue.esm-browser.js"
            }
        }
    </script>
</head>
<body>
    <div id="app">
        <p>{{message}}</p>
    </div>
    <script type="module">
        import {createApp} from "vue";
        createApp({
            data() {
                return {
                    message:"生命周期的Hook钩子"
                }
            },
            created(){
                console.log("响应式数据、计算属性、方法和监听器设置完成，节点未挂载");
                // console.log("mounted"+document.querySelector("p").textContent);
            },
            mounted(){

                console.log("mounted:DOM节点已创建......");
                console.log("mounted"+document.querySelector("p").textContent);
            },
            update(){
                console.log("update:DOM节点重新渲染......");
            },
            umounted(){
                console.log("umounted:DOM节点已卸载......");
            }
        }).mount("#app")
    </script>
</body>
</html>
